﻿using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Xsl;

namespace ConfExpert.Forms.Depo.Kargo
{
    class MyWebBrowser : WebBrowser
    {
        public XmlDocument DocumentXml
        {
            set
            {
                Stream s = new MemoryStream(Encoding.UTF8.GetBytes(global::ConfExpert.Properties.Resources.DHLWebXsl));

                XmlReader xr = XmlReader.Create(s);
                XslCompiledTransform xct = new XslCompiledTransform();
                xct.Load(xr);

                StringBuilder sb = new StringBuilder();
                XmlWriter xw = XmlWriter.Create(sb);
                xct.Transform(value, xw);

                this.DocumentText = sb.ToString();
            }
        }
    }
}
